<?php
/**
 * Active record of Letter
 *
 * @author Lukas Normantas
 */
class Newsletter_Model_Letter extends Doctrine_Record
{

    public function setTableDefinition()
    {
        $this->setTableName('newsletter_letters');
        $this->hasColumn('subject', 'string', 255);
        $this->hasColumn('body', 'clob');
    }

    public function setUp()
    {
        $this->actAs('Timestampable');

        $this->hasOne('Newsletter_Model_SendStatus as SendStatuses', array(
            'local' => 'id',
            'foreign' => 'letter_id'
        ));
    }    
}
